import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import VueSetupExtend from "vite-plugin-vue-setup-extend";
import AutoImport from "unplugin-auto-import/vite";

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  plugins: [
    vue(),
    VueSetupExtend(),
    AutoImport({
      // 后续vue/vue-router/pinia的API都不需要再单独import到setup里面了
      imports: ["vue", "vue-router", "pinia"],
      // dts: "src/auto-imports...", // 可以自定义文件生成的位置与是否生成，默认是根目录下
      // dts: false
    }),
  ],
  server: {
    host: "127.0.0.1",
    port: 5193,
  },
});
